﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using The_Square_Saga.Utils;

namespace The_Square_Saga.Levels
{
    class LevelManager
    {
        private Level currentLevel;

        public Level CurrentLevel
        {
            get { return currentLevel; }
        }

        public List<Level> lstLevel = new List<Level>();

        public LevelManager()
        {
            
        }

        public void loadNextLevel(ContentManager content)
        {
            currentLevel = new Level(GameConfig.getLevelOrder()[currentLevel.getNumLevel()], new Vector2(GameConfig.GAME_WIDTH, GameConfig.GAME_HEIGHT), content);
        }

        public void setLevel(Level level)
        {
            this.currentLevel = level;
        }
        
        
        public void updateLevel(GameTime gameTime, KeyboardState keyboardState)
        {
            this.currentLevel.update(gameTime, keyboardState);
        }
        
        public void drawCurrentLevel(SpriteBatch spriteBatch)
        {
            this.currentLevel.draw(spriteBatch);
        }
    }
}
